package com.chuangsi.project.admin.domain;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.TableName;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* <p>
* 订单表
* </p>
*
* @author ywb
* @since 2025-02-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_pay_order")
@ApiModel(value="PayOrder对象", description="订单表")
    public class PayOrder extends Model<PayOrder> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "pay_order_id", type = IdType.AUTO)
    @NotNull(message="主键id不能为空")
    private Long payOrderId;

    @ApiModelProperty(value = "订单类型（1：线上 2：线下）")
    @NotNull(message="订单类型（1：线上 2：线下）不能为空")
    private Integer orderType;

    @ApiModelProperty(value = "用户id")
    @NotNull(message="用户id不能为空")
    private Long userId;

//    @ApiModelProperty(value = "客户id")
//    private Long customerUserId;

    @ApiModelProperty(value = "印章id")
    @NotBlank(message="印章id不能为空")
    private String sealId;

    @ApiModelProperty(value = "产品id")
    @NotBlank(message="产品id不能为空")
    private String productId;

    @ApiModelProperty(value = "支付用户id")
    private String openId;

    @ApiModelProperty(value = "价格(单价)")
    @NotNull(message="价格(单价)不能为空")
    private BigDecimal price;

    @ApiModelProperty(value = "订单金额（总金额）")
    @NotNull(message="订单金额（总金额）不能为空")
    private BigDecimal fee;

    @ApiModelProperty(value = "状态（1.待付款 2.已付款 3.已退款 ）不能为空")
    @NotNull(message="状态（1.待付款 2.已付款 3.已退款 ）不能为空")
    private Integer status;

    @ApiModelProperty(value = "支付流水（第三方返回的交易号）")
    private String outTradeNo;

    @ApiModelProperty(value = "线下支付截图，用,隔开")
    private String offlinePayPics;

    @ApiModelProperty(value = "支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime payTime;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message="创建时间不能为空")
    private LocalDateTime createTime;


    @Override
    protected Serializable pkVal() {
        return this.payOrderId;
    }

}
